<script>
import axios from 'axios';

export default {
  // 获取所有小组列表
  async listSquads() {
    try {
      console.log('开始请求小组列表');
      const response = await axios.get('/squad/list');
      console.log('小组列表响应:', response);
      return response.data;
    } catch (error) {
      console.error('获取小组列表失败:', error.response || error);
      throw error;
    }
  },

  // 添加新小组
  async addSquad(squad) {
    try {
      const response = await axios.post('/squad/add', squad);
      return response.data;
    } catch (error) {
      console.error('添加小组失败:', error);
      throw error;
    }
  }
}
</script>
